<?php
//连接数据库
	header('Access-Control-Allow-Origin: *');
	$db=mysqli_connect('127.0.0.1','root','','yltravel');
	//判断否连接成功
	if(!mysqli_connect_errno($db)){
		//连接成功
		mysqli_query($db, 'SET NAMES UTF8');
		//拿到用户名和密码		
		$username=$_GET['username'];
		$password=$_GET['password'];
		
		//再拿下剩下的各种信息
		//插入数据库
		$sql=" INSERT INTO info VALUES ('$username','$password')";	
		$result=mysqli_query($db,$sql);
		//判断
		if($result){	
			
			echo json_encode(['code'=>1,'msg'=>'success']);
		}else{
			echo json_encode(['code'=>0,'msg'=>'fail']);
		}
		
		
	}
	else{
		echo "连接失败";
	}



?>